package org.zht.dormpro.auth.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.zht.dormpro.auth.model.SysDept;

import java.util.List;

public interface SysDeptMapper {
    @Delete({"delete from sys_dept where id = #{id,jdbcType=INTEGER}"})
    int deleteByPrimaryKey(Integer id);

    int insertSelective(SysDept record);

    @Select({"select",
            "id, parent_id, name, sort, available, create_time, modify_time, creator, mender, ",
            "dept_append",
            "from sys_dept",
            "where id = #{id,jdbcType=INTEGER}"})
    @ResultMap("org.zht.dormpro.auth.mapper.SysDeptMapper.BaseResultMap")
    SysDept selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysDept record);

    List<SysDept> selectByParentId(Integer deptId);

    int deleteByParentId(Integer deptId);

    List<SysDept> getAll();

}